﻿#include "messagenetworkaccessmanager.h"

const static QString MESSAGE_BASE_URL = BASE_URL+"message/";
const static QString MESSAGE_GET_MESSAGES = MESSAGE_BASE_URL+"getMessages";
const static QString MESSAGE_GET_IMPORT_MESSAGES = MESSAGE_BASE_URL+"getImportMessages";
MessageNetworkAccessManager::MessageNetworkAccessManager(QObject *parent) : BaseNetworkAccessManager(parent)
{

}

void MessageNetworkAccessManager::getMessages(QString username){
    QByteArray data;
    data.append("username="+username);

    doPost(MESSAGE_GET_MESSAGES, data);
}

void MessageNetworkAccessManager::getImportMessages(QString username, int ticketAdjustType, int type){
    QByteArray data;

    data.append("username="+username+"&");
    data.append("ticketAdjustType="+QString("%1").arg(ticketAdjustType)+"&");
    data.append("type="+QString("%1").arg(type));

    doPost(MESSAGE_GET_IMPORT_MESSAGES, data);
}
